{extend name='common/_container'}
{block name="content"}
<div class="ibox float-e-margins">
<input type="hidden" name='lock_id' id='lock_id' value="{$info.lock_id}" />
	<div class="ibox-content">
		<div class="form-horizontal" id="CodeInfoForm">
			<div class="row">
				<div class="col-sm-12">
				<!-- form start -->
					<div class="form-group">
						<label class="col-sm-2 control-label">锁名称：</label>
						<div class="col-sm-9">
							<input type="text" id="lock_name" value="" name="lock_name" class="form-control" placeholder="请输入锁名称">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">序列号：</label>
						<div class="col-sm-9">
							<input type="text" id="lock_sn" value="" name="lock_sn" class="form-control" placeholder="请输入序列号">
						</div>
					</div>
					<div class="form-group layui-form">
						<label class="col-sm-2 control-label">需绑手机：</label>
						<div class="col-sm-9">
							<?php if(!isset($info['mobile_check'])){ $info['mobile_check'] = 1; }; ?>
							<input name="mobile_check" value="1" type="radio" {if condition="$info.mobile_check eq '1'"}checked{/if} title="是">
							<input name="mobile_check" value="0" type="radio" {if condition="$info.mobile_check eq '0'"}checked{/if} title="否">
						</div>
					</div>
					<div class="form-group layui-form">
						<label class="col-sm-2 control-label">申请钥匙：</label>
						<div class="col-sm-9">
							<?php if(!isset($info['applyauth'])){ $info['applyauth'] = 0; }; ?>
							<input name="applyauth" value="1" type="radio" {if condition="$info.applyauth eq '1'"}checked{/if} title="开启">
							<input name="applyauth" value="0" type="radio" {if condition="$info.applyauth eq '0'"}checked{/if} title="关闭">
						</div>
					</div>
					<div class="form-group layui-form">
						<label class="col-sm-2 control-label">审核钥匙：</label>
						<div class="col-sm-9">
							<?php if(!isset($info['applyauth_check'])){ $info['applyauth_check'] = 0; }; ?>
							<input name="applyauth_check" value="1" type="radio" {if condition="$info.applyauth_check eq '1'"}checked{/if} title="开启">
							<input name="applyauth_check" value="0" type="radio" {if condition="$info.applyauth_check eq '0'"}checked{/if} title="关闭">
						</div>
					</div>
					<div class="form-group layui-form">
						<label class="col-sm-2 control-label">开门距离(米)：</label>
						<div class="col-sm-9">
							<?php if(!isset($info['location_check'])){ $info['location_check'] = 0; }; ?>
							<input name="location_check" value="0" type="radio" {if condition="$info.location_check eq '0'"}checked{/if} title="不限制">
							<input name="location_check" value="20" type="radio" {if condition="$info.location_check eq '20'"}checked{/if} title="20米内">
							<input name="location_check" value="50" type="radio" {if condition="$info.location_check eq '50'"}checked{/if} title="50米内">
							<input name="location_check" value="100" type="radio" {if condition="$info.location_check eq '100'"}checked{/if} title="100米内">
							<input name="location_check" value="200" type="radio" {if condition="$info.location_check eq '200'"}checked{/if} title="200米内">
							<input name="location_check" value="300" type="radio" {if condition="$info.location_check eq '300'"}checked{/if} title="300米内">
							<input name="location_check" value="500" type="radio" {if condition="$info.location_check eq '500'"}checked{/if} title="500米内">
							<input name="location_check" value="1000" type="radio" {if condition="$info.location_check eq '1000'"}checked{/if} title="1000米内">
							<input name="location_check" value="10000" type="radio" {if condition="$info.location_check eq '10000'"}checked{/if} title="10K米内">
						</div>
					</div>
					<div class="form-group layui-form">
						<label class="col-sm-2 control-label">启用/禁用：</label>
						<div class="col-sm-9">
							<?php if(!isset($info['status'])){ $info['status'] = 1; }; ?>
							<input name="status" value="1" type="radio" {if condition="$info.status eq '1'"}checked{/if} title="启用">
							<input name="status" value="0" type="radio" {if condition="$info.status eq '0'"}checked{/if} title="禁用">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">类型：</label>
						<div class="col-sm-9">
							<?php if(!isset($info['lock_type'])){ $info['lock_type'] = ''; }; ?>
							<select lay-ignore name="lock_type" class="form-control" id="lock_type">
								<option value="">请选择</option>
								{sql query="select locktype_id,locktype_name from cd_locktype"}
									<option value="{$sql.locktype_id}" {if condition="$info.lock_type eq $sql.locktype_id"}selected{/if}>{$sql.locktype_name}</option>
								{/sql}
							</select>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">位置：</label>
						<div class="col-sm-9">
							<div class="input-group" id="id_address_input">
							<textarea id="location" name="location"  class="form-control" placeholder="请输入位置">{$info.location}</textarea>
								<span class="input-group-addon"><span class="glyphicon glyphicon-map-marker"></span></span>
							</div>
						</div>
					</div>
					<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.3&key=ed1fafa0307bb4991da41f54d8a88b46"></script>
					<script src="__PUBLIC__/static/js/plugins/map/bootstrap.AMapPositionPicker.js"></script>
					<script type="text/javascript">
					$(function () {
						var p = $("#id_address_input").AMapPositionPicker();
					});
					</script>
					<div class="form-group layui-form">
						<label class="col-sm-2 control-label">成功弹层方式：</label>
						<div class="col-sm-9">
							<?php if(!isset($info['adnum'])){ $info['adnum'] = 2; }; ?>
							<input name="adnum" value="1" type="radio" {if condition="$info.adnum eq '1'"}checked{/if} title="两图弹层">
							<input name="adnum" value="2" type="radio" {if condition="$info.adnum eq '2'"}checked{/if} title="一张图带链接">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">成功提示图片：</label>
						<div class="col-sm-6">
							<input type="text" id="successimg" value="/uploads/admin/202007/5f1c6367d68fd.jpg" {if condition="config('my.img_show_status') eq true"}onmousemove="showBigPic(this.value)" onmouseout="closeimg()"{/if} name="successimg" class="form-control" placeholder="请输入成功提示图片">
							<span class="help-block m-b-none successimg_process"></span>
						</div>
						<div class="col-sm-2" style="position:relative; right:30px;">
							<span id="successimg_upload"></span>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">成功广告：</label>
						<div class="col-sm-6">
							<input type="text" id="successadimg" value="" {if condition="config('my.img_show_status') eq true"}onmousemove="showBigPic(this.value)" onmouseout="closeimg()"{/if} name="successadimg" class="form-control" placeholder="请输入成功广告">
							<span class="help-block m-b-none successadimg_process"></span>
						</div>
						<div class="col-sm-2" style="position:relative; right:30px;">
							<span id="successadimg_upload"></span>
						</div>
					</div>
					<div class="form-group layui-form">
						<label class="col-sm-2 control-label">点击开门广告：</label>
						<div class="col-sm-9">
							<?php if(!isset($info['hitshowminiad'])){ $info['hitshowminiad'] = 1; }; ?>
							<input name="hitshowminiad" value="0" type="radio" {if condition="$info.hitshowminiad eq '0'"}checked{/if} title="开启">
							<input name="hitshowminiad" value="1" type="radio" {if condition="$info.hitshowminiad eq '1'"}checked{/if} title="关闭">
						</div>
					</div>
					<div class="form-group layui-form">
						<label class="col-sm-2 control-label">开门按钮：</label>
						<div class="col-sm-9">
							<?php if(!isset($info['openbtn'])){ $info['openbtn'] = 1; }; ?>
							<input name="openbtn" value="1" type="radio" {if condition="$info.openbtn eq '1'"}checked{/if} title="开启">
							<input name="openbtn" value="0" type="radio" {if condition="$info.openbtn eq '0'"}checked{/if} title="关闭">
							<span class="help-block m-b-none"> 小程序端开门按钮是否启用</span>
						</div>
					</div>
					<div class="form-group layui-form">
						<label class="col-sm-2 control-label">扫码开门广告：</label>
						<div class="col-sm-9">
							<?php if(!isset($info['qrshowminiad'])){ $info['qrshowminiad'] = 1; }; ?>
							<input name="qrshowminiad" value="0" type="radio" {if condition="$info.qrshowminiad eq '0'"}checked{/if} title="开启">
							<input name="qrshowminiad" value="1" type="radio" {if condition="$info.qrshowminiad eq '1'"}checked{/if} title="关闭">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">开门成功外链：</label>
						<div class="col-sm-9">
							<input type="text" id="openadurl" value="https://mp.weixin.qq.com/s/UtKqS8FN73aai2PJTeHRig" name="openadurl" class="form-control" placeholder="请输入开门成功外链">
						</div>
					</div>
					<div class="form-group layui-form">
						<label class="col-sm-2 control-label">开门通知：</label>
						<div class="col-sm-9">
							<?php if(!isset($info['opsucnt'])){ $info['opsucnt'] = 0; }; ?>
							<input name="opsucnt" value="1" type="radio" {if condition="$info.opsucnt eq '1'"}checked{/if} title="开启">
							<input name="opsucnt" value="0" type="radio" {if condition="$info.opsucnt eq '0'"}checked{/if} title="关闭">
							<span class="help-block m-b-none">需要关注微门禁公众号,在公众号服务菜单点击订阅通知后才有效</span>
						</div>
					</div>
				<!-- form end -->
				</div>
			</div>
			<div class="hr-line-dashed"></div>
			<div class="row btn-group-m-t">
				<div class="col-sm-9 col-sm-offset-1">
					<button type="button" class="btn btn-primary" onclick="CodeInfoDlg.add()" id="ensure">
						<i class="fa fa-check"></i>&nbsp;确认提交
					</button>
					<button type="button" class="btn btn-danger" onclick="CodeInfoDlg.close()" id="cancel">
						<i class="fa fa-eraser"></i>&nbsp;取消
					</button>
				</div>
			</div>
		</div>
	</div>
</div>
<script src="__PUBLIC__/static/js/admin/Lock.js?t=<?php echo rand(1000,9999)?>" charset="utf-8"></script>
<script src="__PUBLIC__/static/js/upload.js" charset="utf-8"></script>
<script src="__PUBLIC__/static/js/plugins/layui/layui.js?t=1498856285724" charset="utf-8"></script>
<script src='__PUBLIC__/static/js/plugins/paixu/jquery-migrate-1.1.1.js'></script>
<script src='__PUBLIC__/static/js/plugins/paixu/jquery.dragsort-0.5.1.min.js'></script>
<script>
layui.config({dir: '__PUBLIC__/static/js/plugins/layui/'});
	layui.use(['form'], function () {
	window.form = layui.form();
});
uploader('successimg_upload','successimg','image',false,'','{:url("admin/Upload/uploadImages")}');
uploader('successadimg_upload','successadimg','image',false,'','{:url("admin/Upload/uploadImages")}');
laydate.render({elem: '#create_time',type: 'datetime',trigger:'click'});
</script>


{/block}
